import { QuestionCircleOutlined } from '@ant-design/icons'
import { Space, TableColumnsType, Tooltip, Typography } from 'antd'
import { NavigateFunction } from 'react-router-dom'
import { QuotationTrackVO as ITableData } from './types'
export const useIndexColumns = ({ navigate }: { navigate: NavigateFunction }): TableColumnsType<ITableData> => [
  {
    title: '大类',
    dataIndex: 'bigClassName',
    key: 'bigClassName',
    align: 'center',
    width: 120,
    render: (info) => {
      return info || '-'
    },
  },
  {
    title: '供应商编码',
    dataIndex: 'supplierCode',
    key: 'supplierCode',
    align: 'center',
    fixed: 'left',
    width: 150,
    render: (info) => {
      return info || '-'
    },
  },
  {
    title: '供应商简称',
    dataIndex: 'supplierShortName',
    key: 'supplierShortName',
    align: 'center',
    width: 100,
    render: (info) => {
      return info || '-'
    },
  },
  {
    title: (
      <div>
        总款数
        <span style={{ marginLeft: 4, cursor: 'pointer' }}>
          <Tooltip placement="top" title={'不包含已停用或未选中的款式'}>
            <QuestionCircleOutlined />
          </Tooltip>
        </span>
      </div>
    ),
    dataIndex: 'totalQty',
    key: 'totalQty',
    align: 'center',
    width: 100,
    render: (info) => {
      return info || '-'
    },
  },
  {
    title: '已报价款数',
    dataIndex: 'quotationQty',
    key: 'quotationQty',
    align: 'center',
    width: 100,
    render: (info) => {
      return info || '-'
    },
  },
  {
    title: '已选中款数',
    dataIndex: 'confirmedQty',
    key: 'confirmedQty',
    align: 'center',
    width: 100,
    render: (info) => {
      return info || '-'
    },
  },
  {
    title: '意向选中款数',
    dataIndex: 'intentQty',
    key: 'intentQty',
    align: 'center',
    width: 120,
    render: (info) => {
      return info || '-'
    },
  },
  {
    title: '报价进度',
    dataIndex: 'quotationProgress',
    key: 'quotationProgress',
    align: 'center',
    width: 100,
    render: (info) => {
      return info >= 0 ? Number(info) + '%' : '-'
    },
  },
  {
    title: '已核价款数',
    dataIndex: 'checkPriceQty',
    key: 'checkPriceQty',
    align: 'center',
    width: 100,
    render: (info) => {
      return info || '-'
    },
  },
  {
    title: '核价进度',
    dataIndex: 'checkPriceProgress',
    key: 'checkPriceProgress',
    align: 'center',
    width: 100,
    render: (info) => {
      return info >= 0 ? Number(info) + '%' : '-'
    },
  },
  {
    title: '议价中款数',
    dataIndex: 'negotiationQty',
    key: 'negotiationQty',
    align: 'center',
    width: 100,
    render: (info) => {
      return info || '-'
    },
  },
  {
    title: '议价进度',
    dataIndex: 'negotiationProgress',
    key: 'negotiationProgress',
    align: 'center',
    width: 100,
    render: (info) => {
      return info >= 0 ? Number(info) + '%' : '-'
    },
  },
  {
    title: '价格已确认款数',
    dataIndex: 'priceConfirmedQty',
    key: 'priceConfirmedQty',
    align: 'center',
    width: 120,
    render: (info) => {
      return info || '-'
    },
  },
  {
    title: '价格确认进度',
    dataIndex: 'priceConfirmedProgress',
    key: 'priceConfirmedProgress',
    align: 'center',
    width: 120,
    render: (info) => {
      return info >= 0 ? Number(info) + '%' : '-'
    },
  },
  {
    title: '价格未确认款数',
    dataIndex: 'priceUnconfirmedQty',
    key: 'priceUnconfirmedQty',
    align: 'center',
    width: 120,
    render: (info) => {
      return info || '-'
    },
  },
]
